<template>
  <view class="container">
    <navbar :config="config" backColor="#fff"></navbar>
    <view v-if="false">
      <view class="audit bg-F5FFF9 u-text-center" v-if="dataform.audit_status==0">
        <view class="pr">
          <image class="auditImg" :src="imgUrl+'/audit.png'"></image>
          <!-- <text class="iconfont font58">&#xe710;</text> -->
          <image class="font58" :src="imgUrl+'/info.png'"></image>
        </view>
        <view class="u-mt15">申请将在1-3个工作日内处理完成</view>
      </view>
      <view class="audit bg-F5FFF9 u-text-center" v-if="dataform.audit_status==1">
        <image class="auditImg" :src="imgUrl+'/audit.png'"></image>
        <view class="u-mt15">审核通过</view>
      </view>
      <view class="audit bg-F5FFF9 u-text-center" v-if="dataform.audit_status==2">
        <view class="pr">
          <image class="auditImg" :src="imgUrl+'/audit.png'"></image>
          <!-- <text class="iconfont font58">&#xe637;</text> -->
          <image class="font58" :src="imgUrl+'/close.png'"></image>
        </view>
        <view class="u-mt15">审核不通过， {{dataform.audit_remark}}</view>
      </view>
    </view>
    <view class="u-plr30 u-bg-fff pt48">
      <view class="u-flex-center-sb">
        <view>企业名称</view>
        <view class="u-font26 u-999">{{dataform.company_name}}</view>
      </view>
      <view class="u-flex-center-sb u-mt15" style="align-items: flex-start;">
        <view style="width: 180rpx;">统一信用代码</view>
        <view class="u-font26 u-999 u-flex1 u-text-right">{{dataform.credit_code}}</view>
      </view>
      <view class="u-flex-center-sb u-mt15" style="align-items: flex-start;">
        <view style="width: 180rpx;">经营范围</view>
        <view class="u-font26 u-999 u-flex1 u-text-right">{{dataform.business_scope}}</view>
      </view>
      <view class="u-flex-center-sb u-mt15">
        <view>企业所在地区</view>
        <view class="u-font26 u-999 ">{{dataform.province}}</view>
      </view>
      <view class="u-flex-center-sb u-mt15" style="align-items: flex-start;">
        <view style="width: 180rpx;">详细地址</view>
        <view class="u-font26 u-999  u-flex1 u-text-right">{{dataform.company_address}}</view>
      </view>
      <view class="u-flex-center-sb u-mt15">
        <view>法人姓名</view>
        <view class="u-999">{{dataform.legal_representative}}</view>
      </view>
      <view class="u-flex-center-sb u-mt15">
        <view>证件类型</view>
        <view class="u-font26 u-999">{{dataform.id_type==0?'身份证':'护照'}}</view>
      </view>
      <view class="u-flex-center-sb u-mt15">
        <view style="width: 180rpx;">证件号码</view>
        <view class="u-font26 u-999  u-flex1 u-text-right" style="word-break:break-all;">{{dataform.id_number}}</view>
      </view>
      <view class="u-flex-center-sb u-mt15">
        <view>法人手机号</view>
        <view class="u-font26 u-999">{{dataform.lr_mobile}}</view>
      </view>
      <view class="u-flex-center-sb u-mt15">
        <view>法人邮箱</view>
        <view class="u-font26 u-999">{{dataform.lr_email}}</view>
      </view>
      <view class="u-mt15">
        <view>营业执照</view>
        <view>
          <image class="img-wt-ht" v-for="item in dataform.business_license_images" :src="item" mode="aspectFill">
          </image>
        </view>
      </view>
      <view class="u-mt15">
        <view>申请身份证</view>
        <view>
          <image class="img-wt-ht" v-for="item in dataform.identty_images" :src="item" mode="aspectFill"></image>
        </view>
      </view>
    </view>

    <view class="u-plr30 u-bg-fff u-mt10 pt35 pb150">
      <view class="u-flex-center-sb">
        <view>店铺名称</view>
        <view class="u-font26 u-999">{{dataform.shop_name}}</view>
      </view>
      <view class="u-flex-center-sb u-mt15">
        <view style="width: 200rpx;">店铺所在地区</view>
        <view class="u-font26 u-999">
          {{dataform.province_name}}{{dataform.city_name}}{{dataform.street_name}}{{dataform.city_name}}{{dataform.community_name}}
        </view>
      </view>
      <view class="u-flex-center-sb u-mt15" style="align-items: flex-start;">
        <view style="width: 180rpx;">详细地址</view>
        <view class="u-font26 u-999 u-flex1 u-text-right">{{dataform.address}}</view>
      </view>
      <view class="u-flex-center-sb u-mt15" style="align-items: flex-start;">
        <view style="width: 180rpx;">定位地址</view>
        <view class="u-font26 u-999 u-flex1 u-text-right">{{dataform.map_punctuation}}</view>
      </view>
      <view class="u-flex-center-sb u-mt15">
        <view>售后电话</view>
        <view class="u-font26 u-999">{{dataform.customer_service_phone}}</view>
      </view>
      <view class="u-flex-center-sb u-mt15">
        <view>营业时间</view>
        <view class="u-font26 u-999">{{dataform.business_hours}}</view>
      </view>
      <view class="u-flex-center-sb u-mt15">
        <view>时间段</view>
        <view class="u-font26 u-999" v-if="dataform.time_quantum != null">{{dataform.time_quantum}}</view>
      </view>
      <view class="u-mt15">
        <view>商业主体名称</view>
        <view class="u-font26 u-999 u-mt15">{{dataform.main_name}}</view>
      </view>
      <view class="u-mt15">
        <view>运营姓名</view>
        <view class="u-font26 u-999 u-mt15">{{dataform.loser}}</view>
      </view>
      <view class="u-mt15">
        <view>运营人手机号</view>
        <view class="u-font26 u-999 u-mt15">{{dataform.mobile}}</view>
      </view>
      <template v-if="dataform.union_business">
        <view class="u-flex-center-sb u-mt15">
          <view>门店打赏比例</view>
          <view class="u-font26 u-999 u-mt15">{{dataform.reward_ratio}}%</view>
        </view>
        <view class="u-mt15">
          <view>优惠介绍</view>
          <view class="u-font26 u-999 u-mt15">{{dataform.special_offers}}</view>
        </view>
      </template>
      <view class="u-mt15">
        <view>店铺简介</view>
        <view class="u-font26 u-999 u-mt15">{{dataform.remark}}</view>
      </view>
      <view class="u-mt15">
        <view>场地说明</view>
        <view class="u-font26 u-999 u-mt15" v-if="dataform.place_remark">{{dataform.place_remark}}</view>
      </view>
      <view class="u-mt15">
        <view>店铺logo</view>
        <view>
          <image class="imglogo" :src="dataform.logo" mode="aspectFill"></image>
        </view>
      </view>
      <view class="">
        <view>店铺图片</view>
        <view>
          <image class="img-wt-ht" v-for="item in dataform.store_images" :src="item" mode="aspectFill"></image>
        </view>
      </view>
    </view>
    <view class="btn">
      <button class="fixed-btn" @click="goRegister">修改店铺信息</button>
    </view>
  </view>
</template>

<script>
  import uniPopup from "../../../components/uni-popup/uni-popup.vue"
  export default {
    components: {
      uniPopup
    },
    data() {
      return {
        config: {
          back: true, //false是tolbar页面 是则不写
          title: '店铺管理',
          color: '#fff',
          //背景颜色;参数一：透明度（0-1）;参数二：背景颜色（array则为线性渐变，string为单色背景）
          backgroundColor: [1, "#FF721B"],
          statusBarFontColor: '#1A1A1A',
          backPage: "/pages/index/personal"
          // backPage:"/pages/entrepreneurshipZone/index"
        },
        dataform: {
          audit_status: 0,
          company_name: '', //企业名称
          credit_code: '', //统一信用代码
          business_scope: '', //经营范围
          province: '', //企业省市区
          company_address: '', //企业住址
          legal_representative: '', //法人姓名
          id_type: null, //法人代证件类型（0身份证、1护照）
          lr_mobile: '', //法人手机号
          loser: "", //负者人姓名
          mobile: "", //运营人电话
          identity_code: "", //身份证号
          shop_name: "", //店铺名
          province_name: "", //省的名称
          province_code: "", //省编号
          city_code: "", //市编号
          city_name: "", //市名称
          area_name: "", //区名称
          area_code: "", //区编号
          address: "", //详细地址
          business_hours: "", //营业时间
          remark: "", //场地说明
          loser: '', //运营人姓名
          customer_service_phone: '', //客服电话
          main_name: '', //商业主体名称
          noticeItems: "", //注意事项
          logo: "", //店铺logo
          store_images: [], //门店图片
          business_license_images: [], //商家经营执照
          identty_images: [], //身份证下反面
          tx_longitude: "", //微信经度
          tx_latitude: "", //微信纬度
        },
        audit_status: "1", //审核状态（0待审核，1审核通过，2审核不通过）
        checkedArrey: [],
        beginTime: "",
        endTime: "",
        imgUrl: this.$mConfig.staticUrl
      }
    },
    onLoad() {
      let that = this;
      //获取店铺信息
      this.$http.get('/yxt/shop/my-shop', {
        union_business: true
      }).then(async res => {
        if (res && res.code == 200) {
          //将字符串转成图片数组
          // if(res.data.logo){
          // 	res.data.logo = res.data.logo.split(',')
          // }
          if (res.data.business_license_images) {
            res.data.business_license_images = res.data.business_license_images.split(',')
          }
          if (res.data.identty_images) {
            res.data.identty_images = res.data.identty_images.split(',')
          }
          if (res.data.store_images) {
            res.data.store_images = res.data.store_images.split(',')
          }
          //拆分时间
          if (res.data.time_quantum) {
            this.beginTime = res.data.time_quantum.split('-')[0]
            this.endTime = res.data.time_quantum.split('-')[0]
          }
          this.dataform = res.data
        }
      })
    },
    methods: {
      goRegister() {
        uni.navigateTo({
          url: '/pages/workbench/shop/registerAndAudit?type=1&settleMode=1'
        })
      },

    }
  }
</script>

<style lang="scss">
  page {
    background-color: #F5F5F5;
  }

  .bg-F5FFF9 {
    background-color: #F5FFF9;
  }

  .audit {
    padding: 42rpx 0rpx;
  }

  .auditImg {
    width: 214rpx;
    height: 160rpx;
  }

  .pr {
    position: relative;
  }

  .font58 {
    // color: #0B844A;
    // font-size: 58rpx;
    width: 58rpx;
    height: 58rpx;
    position: absolute;
    bottom: 30rpx;
    left: 50%;
    transform: translateX(-50%);
    // left: 40rpx;
    // right: 0;
  }

  .img-wt-ht {
    width: 314rpx;
    height: 190rpx;
    margin-right: 24rpx;
    margin-top: 22rpx;
    margin-bottom: 40rpx;
  }

  .imglogo {
    width: 154rpx;
    height: 154rpx;
    border-radius: 50%;
    border: 1rpx solid #e6e6e6;
    margin-top: 24rpx;
    margin-bottom: 15rpx;
  }

  .pt35 {
    padding-top: 35rpx;
  }

  .pt48 {
    padding-top: 48rpx;
  }

  .pb150 {
    padding-bottom: 150rpx;
  }

  .btn {
    position: fixed;
    bottom: 40rpx;
    left: 0;
    right: 0;
    width: 100%;

    .fixed-btn {
      margin: 0 30rpx;
      height: 86rpx;
      background: #FF721B;
      border-radius: 43rpx;
      font-size: 30rpx;
      color: #fff;
      text-align: center;
      line-height: 86rpx;
    }
  }
</style>
